<template>
  <div class="EmployeeShenhe">
    <!-- 头部 -->
    <div class="Title">
      <div class="blue"></div>
      <span class="title">借调申请</span>
      <el-button
        class="right-box"
        type="info"
        icon="el-icon-back"
        onclick="window.history.go(-1)"
      >返回</el-button>
    </div>

    <div class="employeeShenhe">
      <div class="empphone">
        <div class="examine-box">
          <div class="leftexam-box">
            <p>提交申请</p>
            <span>2019.06.11 09：50</span>
          </div>
          <div class="Middlexam-box"></div>
          <div class="rightexam-box">
            <p>管理部：未审核</p>
            <span>2019.06.11 09：50</span>
          </div>
        </div>
      </div>
      <div class="empphone_low">
        <template>
          <el-table :data="tableData" border style="width: 100%">
            <el-table-column prop="chejian" label="申请车间" align="center"></el-table-column>
            <el-table-column prop="gangwei" label="借调岗位" align="center"></el-table-column>
            <el-table-column prop="empnolist" label="借调人数" align="center"></el-table-column>
            <el-table-column prop="daogang" label="到岗时间" align="center"></el-table-column>
            <el-table-column prop="guihuan" label="归还时间" align="center"></el-table-column>
          </el-table>
        </template>
      </div>
      <div class="empphone_Btn">
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item>
            <!-- <el-button type="primary" @click="onSubmit">通过</el-button> -->
            <el-button type="info" onclick="window.history.go(-1)">取消</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>
    
<script>
import axios from "axios";
export default {
  data() {
    return {
      tableData: [],
      form: {}
    };
  },
  created() {
    this.Detail = this.$route.query.prod;
    this.Row = this.$route.query.row;
    console.log(this.$route.query.prod);
    console.log(this.$route.query.row);
    this.getDetail();
  },
  methods: {
    getDetail() {
      var obj = {
        depart: this.Detail,
        applyforon: this.Row
      };
      var objs = JSON.stringify(obj);
      axios(
        "apis/ProductionManagement.asmx/Det?index=39&jsondata=" + objs
      ).then(({ data }) => {
        console.log(data, "shuju");
        var datas = this.$x2js.xml2js(data);
        var list = JSON.parse(datas.string.__text);
        console.log(list)
        var dd = new Date(parseInt(list.daogang.substr(6, 13)));
        var y = dd.getFullYear();
        var m = dd.getMonth() + 1;
        m = m < 10 ? "0" + m : m;
        var d = dd.getDate();
        d = d < 10 ? "0" + d : d;
        list.daogang = y + "-" + m + "-" + d + " ";
        var ddd = new Date(parseInt(list.guihuan.substr(6, 13)));
        var yy = ddd.getFullYear();
        var mm = ddd.getMonth() + 1;
        mm = mm < 10 ? "0" + mm : mm;
        var dddd = ddd.getDate();
        dddd = dddd < 10 ? "0" + dddd : dddd;
        list.guihuan = yy + "-" + mm + "-" + dddd + " ";
        this.tableData.push(list);
      });
    },
    onSubmit() {}
  }
};
</script>

<style lang="scss" scoped>
@import "@/assets/scss/base.scss";
.EmployeeShenhe {
  width: 99%;
  height: 700px;
  //   border: 1px solid red;
}
.Title {
  width: 99%;
  height: 35px;
  margin-top: 10px;
}
.blue {
  width: 5px;
  height: 20px;
  background-color: $Header_color;
  margin-left: 20px;
  margin-top: 5px;
  float: left;
}
.title {
  margin-left: 10px;
  line-height: 35px;
}
.employeeShenhe {
  width: 99%;
  height: 100%;
  margin-left: 15px;
  // border: 1px solid #000;
}
.examine-box {
  width: 100%;
  height: 112px;
  overflow: hidden;
  // border: 1px solid red;
}
.leftexam-box {
  width: 15%;
  height: 110px;
  float: left;
  border-radius: 8px;
  border: 1px solid $bordercolor;
}
.leftexam-box p {
  width: 100%;
  line-height: 70px;
  font-size: $font-size-medium-x;
  font-weight: bold;
  text-align: center;
}
.leftexam-box span {
  display: inline-block;
  width: 100%;
  font-size: $font-size-medium;
  text-align: center;
}
.Middlexam-box {
  width: 69.5%;
  height: 8px;
  margin-top: 51px;
  float: left;
  border-top: 1px solid #93a0e5;
  border-bottom: 1px solid #93a0e5;
  background-color: #a9b4ed;
}
.rightexam-box {
  width: 15%;
  height: 110px;
  float: left;
  border-radius: 8px;
  background-color: #5167d2;
  // border:1px solid red;
}
.rightexam-box p {
  width: 100%;
  line-height: 70px;
  color: $white;
  font-size: $font-size-medium-x;
  font-weight: bold;
  text-align: center;
}
.rightexam-box span {
  display: inline-block;
  width: 100%;
  color: $white;
  font-size: $font-size-medium;
  text-align: center;
}
.empphone {
  width: 80%;
  height: 200px;
  margin: auto;
  margin-top: 20px;
  // border: 1px solid #000;
}
.empphone_low {
  width: 60%;
  margin: 0 auto;
  border: 1px solid $linecolor;
}
.empphone_Btn {
  width: 99%;
  height: 100px;
  margin-top: 30px;
  text-align: center;
  // border: 1px solid #000;
}
.right-box {
  float: right;
  margin-right: 2%;
  border-radius: 5px;
}
</style>
